package demo

object AbstractDemo {

  def main(args: Array[String]): Unit = {
    var rabbit = new Rabbit
    var blackRabbit = new BlackRabbit
    rabbit.eat("屎")

    blackRabbit.eat("尿")


  }

}


trait Animal {
  def eat(something: String)
}

class Rabbit extends Animal {

  def sayhello = println("你们好，我是兔子~")

  override def eat(something: String): Unit = println(s"兔子吃${something}~")
}

class BlackRabbit extends Rabbit with Animal{
  override def sayhello: Unit = println("你们好我是黑兔子~")

  override def eat(something: String): Unit = println(s"黑兔子吃${something}")

}